local name = "i26_food"
local overridebuild = "i26foods"    --动画包

STRINGS.NAMES[string.upper(name)] = "糖葫芦"
STRINGS.CHARACTERS.GENERIC.DESCRIBE[string.upper(name)] = "这是糖葫芦！"
-- 
local assets = {
    -- Asset("ANIM", "anim/cook_pot_food.zip"),
    -- Asset("INV_IMAGE", name),
    Asset("ANIM", "anim/"..overridebuild..".zip"), 
    Asset("ATLAS", "images/iii/"..name..".xml"),
    Asset("IMAGE", "images/iii/"..name..".tex"),
}

local function fn()
    local inst = CreateEntity()

    inst.entity:AddTransform()
    inst.entity:AddAnimState()
    inst.entity:AddNetwork()

    MakeInventoryPhysics(inst)

    inst.AnimState:SetBuild(overridebuild)
    inst.AnimState:SetBank("cook_pot_food")

    inst.AnimState:PlayAnimation("idle")
    inst.AnimState:OverrideSymbol("swap_food", overridebuild, name)
    inst.scrapbook_overridedata = {"swap_food", overridebuild, name}

    inst:AddTag("preparedfood")

    MakeInventoryFloatable(inst)

    inst.entity:SetPristine()

    if not TheWorld.ismastersim then
        return inst
    end

    inst.food_symbol_build = overridebuild

    inst:AddComponent("edible")
    inst.components.edible.healthvalue = 25
    inst.components.edible.sanityvalue = 5
    inst.components.edible.hungervalue = 5

    inst.components.edible.foodtype = FOODTYPE.GOODIES
    inst.components.edible.secondaryfoodtype = nil
    inst.components.edible.temperaturedelta = 0
    inst.components.edible.temperatureduration = 0
    inst.components.edible.nochill = nil
    inst.components.edible.spice = nil
    inst.components.edible:SetOnEatenFn(function(inst, eater)
        if eater and eater.components.i26skill then
            eater.components.i26skill:DoDelta(1)
        end
    end)

    inst:AddComponent("inspectable")

    inst:AddComponent("inventoryitem")
    inst.components.inventoryitem.atlasname = "images/iii/"..name..".xml"

    inst:AddComponent("stackable")
    inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM

    inst:AddComponent("perishable")
    inst.components.perishable:SetPerishTime(TUNING.PERISH_PRESERVED)     --20天
    inst.components.perishable:StartPerishing()
    inst.components.perishable.onperishreplacement = "spoiled_food"

    MakeSmallBurnable(inst)
    MakeSmallPropagator(inst)
    MakeHauntableLaunchAndPerish(inst)

    inst:AddComponent("bait")
    inst:AddComponent("tradable")

    return inst
end



return Prefab(name, fn, assets)